// import Regs from './Regs'

export default {
  props: {
    value: {
      type: String || Number || Object,
      default: () => ({})
    },
    reg: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      oldVal: this.value
    }
  },
  watch: {
    value(val) {
      this.oldVal = val
    }
  },
  computed: {
    val: {
      get() {
        const ret = this.oldVal
        // if (Regs[this.reg]) {
        //   ret = ret.replace(Regs[this.reg], '')
        // }
        this.$emit('input', ret)
        return ret
      },
      set(newVal) {
        this.oldVal = newVal
      }
    }
  }
}
